package com.sujiewon.salesadmin.employee.dao;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.ibatis.sqlmap.client.SqlMapClient;

@Repository
public class EmployeeDaoImpl implements EmployeeDao {

	@Resource(name="sqlMapClient")
	private SqlMapClient sqlMapClient;

	@SuppressWarnings("unchecked")
	@Override
	public List<HashMap<String, Object>> getJobInfoList() throws SQLException {
		return this.sqlMapClient.queryForList("employee.getJobInfoList");
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<HashMap<String, Object>> getDeptInfoList() throws SQLException {
		return this.sqlMapClient.queryForList("employee.getDeptInfoList");
	}

	@SuppressWarnings("unchecked")
	@Override
	public HashMap<String, Object> getSujiEmpInfoByUserId(HashMap<String, Object> paramMap) throws SQLException {
		return (HashMap<String, Object>) this.sqlMapClient.queryForObject("employee.getSujiEmpInfoByUserId", paramMap);
	}

	@Override
	public void insertSujiEmpInfo(HashMap<String, Object> paramMap) throws SQLException {
		this.sqlMapClient.insert("employee.insertSujiEmpInfo", paramMap);
	}

	@SuppressWarnings("unchecked")
	@Override
	public HashMap<String, Object> signin(HashMap<String, Object> paramMap) throws SQLException {
		return (HashMap<String, Object>) this.sqlMapClient.queryForObject("employee.signin", paramMap);
	}

	@Override
	public void updateSujiEmpInfo(HashMap<String, Object> paramMap)	throws SQLException {
		this.sqlMapClient.update("employee.updateSujiEmpInfo", paramMap);
	}
	
	
}
